using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace teste.Models.Mapping
{
    public class OPERADORMap : EntityTypeConfiguration<OPERADOR>
    {
        public OPERADORMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Nome)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.Senha)
                .IsRequired()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("OPERADOR");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Codigo).HasColumnName("Codigo");
            this.Property(t => t.Nome).HasColumnName("Nome");
            this.Property(t => t.Senha).HasColumnName("Senha");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
